package com.huarui.receive.dao.impl;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.impl.BaseDaoImpl;

import com.huarui.receive.dao.IReceiveDao;
import com.huarui.receive.model.Receive;
import com.huarui.receive.model.ReceiveModel;

public class ReceiveDaoImpl extends BaseDaoImpl implements IReceiveDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<ReceiveModel> getReceiveByConditons(Map queryMap) {
		
		return getSqlMapClientTemplate().queryForList(namespace+".getReceiveByConditons", queryMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public Integer getReceiveCountByConditons(Map queryMap) {
		
		return (Integer) getSqlMapClientTemplate().queryForObject(namespace+".getReceiveCountByConditions", queryMap);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public boolean deleteReceiveById(Map map) {
       return getSqlMapClientTemplate().delete(namespace+".deleteReceiveById", map)==1;
		
	}
	@SuppressWarnings("unchecked")
	@Override
	public Receive getReceiveById(Map map) {
		return (Receive) getSqlMapClientTemplate().queryForObject(namespace+".getReceiveById", map);	
	}

	@Override
	public boolean updateReceiveCurrentorId(Map<String, Object> map) {
		return getSqlMapClientTemplate().update(namespace+".updateReceiveCurrentorId", map)==1;
	}
}
